﻿using System.Data.SQLite;
using System.Linq;
using Dapper;
using WeixinSDK;

namespace WeixinMVC.Models
{
    public class DataStore
    {
        SQLiteConnection _conn;

        public DataStore()
        {
            _conn = new SQLiteConnection(System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString);
        }

        public WxSetting GetWxSetting(string appid)
        {
            var sql = "select * from wxSetting where AppId=@AppId";
            return _conn.Query<WxSetting>(sql, new { AppId = appid }).FirstOrDefault();
        }
    }
}